package org.real.guetshop.controller.user;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.real.guetshop.pojo.dto.DetailDTO;
import org.real.guetshop.pojo.dto.MerchantLoginDTO;
import org.real.guetshop.pojo.dto.MerchantRegisterDTO;
import org.real.guetshop.pojo.entity.Store;
import org.real.guetshop.pojo.vo.MerchantLoginVO;
import org.real.guetshop.pojo.vo.StoreVO;
import org.real.guetshop.propertis.JwtProperties;
import org.real.guetshop.result.Result;
import org.real.guetshop.service.MerchantService;
import org.real.guetshop.utils.JwtUtil;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@RestController("userMerchantController")
@RequestMapping("/user/merchant")
@Slf4j
public class MerchantController {

    @Resource
    private MerchantService merchantService;

    @GetMapping("/get")
    public Result<List<StoreVO>> getMerchant(){
        log.info("用户获取商家列表......");
        List<StoreVO> list = merchantService.getMerchant();

        return Result.success(list);
    }

    @GetMapping("/getStore/{storeId}")
    public Result<StoreVO> getStore(@PathVariable Integer storeId){
        log.info("商家获取商家信息：{}",storeId);
        return Result.success(merchantService.getStoreInfo(storeId));
    }

}
